package org.mat.ipaas.ucenter.service.api.system;

import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.mat.framework.lang.dto.MatApiResponse;
import org.mat.ipaas.ucenter.service.dto.system.entity.SysAnnouncementSendDTO;
import org.mat.ipaas.ucenter.service.dto.system.model.AnnouncementSendModelDTO;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.cloud.openfeign.SpringQueryMap;
import org.springframework.web.bind.annotation.*;

import javax.servlet.http.HttpServletRequest;

 /**
 * @Title: Controller
 * 用户通告阅读标记表
 */
 @FeignClient(name = "mat-ipaas-ucenter-service",contextId = "sys-announcement-send-rest-api")
public interface SysAnnouncementSendRestAPI {

	/**
	  * 分页列表查询
	 * @param sysAnnouncementSendDTO
	 * @param pageNo
	 * @param pageSize
	 * @param req
	 * @return
	 */
	@GetMapping(value = "/sys/sysAnnouncementSend/list")
    MatApiResponse<IPage<SysAnnouncementSendDTO>> queryPageList(SysAnnouncementSendDTO sysAnnouncementSendDTO,
																@RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
																@RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
																@RequestParam HttpServletRequest req);
	
	/**
	  *   添加
	 * @param sysAnnouncementSendDTO
	 * @return
	 */
	@PostMapping(value = "/sys/sysAnnouncementSend/add")
    MatApiResponse<SysAnnouncementSendDTO> add(@RequestBody SysAnnouncementSendDTO sysAnnouncementSendDTO);
	
	/**
	  *  编辑
	 * @param sysAnnouncementSendDTO
	 * @return
	 */
	@PutMapping(value = "/sys/sysAnnouncementSend/edit")
    MatApiResponse<SysAnnouncementSendDTO> eidt(@RequestBody SysAnnouncementSendDTO sysAnnouncementSendDTO);
	
	/**
	  *   通过id删除
	 * @param id
	 * @return
	 */
	@DeleteMapping(value = "/sys/sysAnnouncementSend/delete")
    MatApiResponse<SysAnnouncementSendDTO> delete(@RequestParam(name = "id", required = true) String id);
	
	/**
	  *  批量删除
	 * @param ids
	 * @return
	 */
	@DeleteMapping(value = "/sys/sysAnnouncementSend/deleteBatch")
    MatApiResponse<SysAnnouncementSendDTO> deleteBatch(@RequestParam(name = "ids", required = true) String ids);
	
	/**
	  * 通过id查询
	 * @param id
	 * @return
	 */
	@GetMapping(value = "/sys/sysAnnouncementSend/queryById")
    MatApiResponse<SysAnnouncementSendDTO> queryById(@RequestParam(name = "id", required = true) String id);
	
	/**
	 * @功能：更新用户系统消息阅读状态
	 * @param json
	 * @return
	 */
	@PutMapping(value = "/sys/sysAnnouncementSend/editByAnntIdAndUserId")
    MatApiResponse<SysAnnouncementSendDTO> editById(@RequestBody JSONObject json);
	
	/**
	 * @功能：获取我的消息
	 * @return
	 */
	@GetMapping(value = "/sys/sysAnnouncementSend/getMyAnnouncementSend")
    MatApiResponse<Page<AnnouncementSendModelDTO>> getMyAnnouncementSend(@SpringQueryMap AnnouncementSendModelDTO announcementSendModelDTO,
                                                                         @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
                                                                         @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize);
	/**
	 * @功能：一键已读
	 * @return
	 */
	@PutMapping(value = "/sys/sysAnnouncementSend/readAll")
    MatApiResponse<SysAnnouncementSendDTO> readAll();


	 /**
	  * 根据消息发送记录ID获取消息内容
	  * @param sendId
	  * @return
	  */
	 @GetMapping(value = "/sys/sysAnnouncementSend/getOne")
     MatApiResponse<AnnouncementSendModelDTO> getOne(@RequestParam(name = "sendId", required = true) String sendId);
}
